package com.example.eurekaclient002.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class TraceController {


    private static final Logger logger = LoggerFactory.getLogger(TraceController.class);

    @Autowired
    RestTemplate restTemplate;

    @GetMapping(value = "/trace-2")
    public String trace() {
        logger.info("===call trace-2===");
        return restTemplate.getForEntity("http://trace-3/trace-3", String.class).getBody();
    }
}
